@echo off & setlocal enabledelayedexpansion
title Cloud-Governor

set SCRIPT_BIN=%~dp0
cd..
set BASEDIR=%CD%
cd %SCRIPT_BIN%

rem 设置日志路径及日志文件前缀
set LOGPATH=%BASEDIR%\logs
if exist "%LOGPATH%" (
    echo log dir %LOGPATH% existsd!
) else (
    echo mkdir %LOGPATH%
    md "%LOGPATH%"
)

rem -----------------------------------------------------------
rem start Cloud-Governor(windows)
rem -----------------------------------------------------------

set MAINCLASS=cn.chenjun.cloud.management.ManagementApplication
set LIB_DIR=lib
set CLASS_DIR=conf
set PRO_ARGS=
set JVM_ARGS=-Dapp.home=%BASEDIR% -Djava.library.path=%BASEDIR%\conf
set APP_HOME=%BASEDIR%

set jcommand=java.exe
set runtype=-classpath
set LIB_DIR=%BASEDIR%\%LIB_DIR%
set CLASSES_DIR=%BASEDIR%\%CLASS_DIR%;%LIB_DIR%\*
set APPEND_LIB=%CLASSES_DIR%
set FILE_SUFFIX=*.jar

@echo SCRIPT_BIN: %SCRIPT_BIN%
@echo MAINCLASS: %MAINCLASS%
@echo BASEDIR: %BASEDIR%
@echo off

%jcommand% %JVM_ARGS% %runtype% %APPEND_LIB% %MAINCLASS% %PRO_ARGS%